<?php
	header("Content-Type: text/html;charset=utf-8");
	include("function/_nosql.php");
	include("function/function.php");
	
	$newsid = trim($_REQUEST['newsid']);
	if(is_numeric($newsid)){
		$sql="select * from kboy_trailfoot where id=$newsid";
		$rows=mysql_query($sql);
		$nums=mysql_num_rows($rows);
		if($nums>0){
			$rs=mysql_fetch_array($rows);
				$trailfoot_title = $rs['trailfoot_title'];
				$trailfoot_pic = $rs['trailfoot_pic'];
				$trailfoot_pic2 = $rs['trailfoot_pic2'];
				$trailfoot_pic3 = $rs['trailfoot_pic3'];
				$trailfoot_pic4 = $rs['trailfoot_pic4'];
				$trailfoot_startime = $rs['trailfoot_startime'];
				$trailfoot_duration = $rs['trailfoot_duration'];
				$trailfoot_line = $rs['trailfoot_line'];
				$trailfoot_allline = $rs['trailfoot_allline'];
				$trailfoot_power = $rs['trailfoot_power'];
				$trailfoot_rise = $rs['trailfoot_rise'];
				$trailfoot_drop = $rs['trailfoot_drop'];
				$trailfoot_taltitude = $rs['trailfoot_taltitude'];
				$trailfoot_baltitude = $rs['trailfoot_baltitude'];
				$trailfoot_speed = $rs['trailfoot_speed'];
				$trailfoot_writer = $rs['trailfoot_writer'];
				$trailfoot_map = stripslashes($rs['trailfoot_map']);
				$trailfoot_about = stripslashes($rs['trailfoot_about']);
				$trailfoot_footline = stripslashes($rs['trailfoot_footline']);
				$trailfoot_foot = stripslashes($rs['trailfoot_foot']);
		}else{
			echo erro("该信息已被删除或不存在");
		}
	}else{
		echo erro("该信息已被删除或不存在");
	}
	mysql_query("update kboy_trailfoot set trailfoot_hit = trailfoot_hit + 1 where id=$newsid");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?= $trailfoot_title ?>_<?= $web_titles?></title>
<meta name="Keywords" content="<?= $trailfoot_title ?>,<?= $web_keywords ?>" />
<meta name="Description" content="<?= $web_description ?>" />
<link rel="stylesheet" href="css/common.css"/>
<link rel="stylesheet" href="css/style.css"/>
</head>
<body>
    <!--top-bar begin-->
	<? include("_include.top.topbar.php") ?>
    <!--top-bar end-->
    <!--header begin-->
	<? include("_include.top.navbar.php") ?>
    <!--header end-->
    <div class="inner-banner">
        <div class="inner-pic"><img src="images/ban2.jpg" alt=""/></div>
        <!--<div class="search-box">
			<form name="SearchForm" id="SearchForm" method="post" action="active_search.php">
            <input type="text" class="search-text input_wby" holdplace="搜索目的地/攻略/活动" name="search_text"/>
            <input type="submit" class="search-send" value=""/>
			</form>
        </div>-->
    </div>
    <!--banner end-->
    <!--活动 begin-->
    <div class="f-item-box np">
        <div class="content">
            <div class="breadcrumb"><a href="index.php">首页</a>&gt;<a href="trailfoot.php">步道</a></div>
            <div class="bd-content">
                <div class="con-pane on">
                    <div class="mdd-box">
                        <div class="mdd-detail">
                            <div class="mdd-top">
                                <div class="show-pic"><img src="<?=$trailfoot_pic?>" width="308" height="207" alt=""/></div>
                                <div class="mdd-intro">
                                    <h3><?=$trailfoot_title?></h3>
                                    <div class="mdd-1">于 <span><?=$trailfoot_startime?></span>,历时 <span><?=$trailfoot_duration?>&nbsp;<?=$trailfoot_allline?></span></div>
                                    <div class="mdd-2">
                                        <span class="good"><i></i>收藏</span>
                                        <span class="share"><i></i>分享</span>
                                        <span class="watch"><i></i>3512</span>
                                    </div>
                                    <div class="mdd-3">
                                        <ul>
                                            <li>线路：<span><?=$trailfoot_line?></span></li>
                                            <li>强度等级：<span><?=$trailfoot_power?></span></li>
                                            <li>累计上升：<span><?=$trailfoot_rise?></span></li>
                                            <li>累计下降：<span><?=$trailfoot_drop?></span></li>
                                            <li>海拔最低：<span><?=$trailfoot_baltitude?></span></li>
                                            <li>海拔最高：<span><?=$trailfoot_taltitude?></span></li>
                                            <li>最高速度：<span><?=$trailfoot_speed?></span></li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                            <div class="mdd-bd">
                                <div class="mdd-bd-nav">
                                    <ul>
                                        <li class="on"><a href="#d-mdd-mp">目的地地图</a></li>
                                        <li><a href="#d-mdd-intro">目的地简介</a></li>
                                        <li><a href="#d-mdd-line">步道线路</a></li>
                                        <li><a href="#d-mdd-zj">足迹</a></li>
                                        <li><a href="#d-mdd-pj">驴友评价</a></li>
                                    </ul>
                                </div>
                                <div class="mdd-con">
                                    <div class="mdd-con-l">
                                        <div class="mdd-item" id="d-mdd-mp">
                                            <div class="title"><h3>目的地地图</h3></div>
                                            <div class="mdd-item-con">
                                                <?=$trailfoot_map?>
                                            </div>
                                        </div>
                                        <div class="mdd-item" id="d-mdd-intro">
                                            <div class="title"><h3>目的地简介</h3></div>
                                            <div class="mdd-item-con">
                                                <div class="con">
                                                    <?=$trailfoot_about?>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="mdd-item" id="d-mdd-line">
                                            <div class="title"><h3>步道路线</h3></div>
                                            <div class="mdd-item-con">
                                                <div class="con">
                                                    <?=$trailfoot_footline?>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="mdd-item" id="d-mdd-zj">
                                            <div class="title"><h3>足迹</h3></div>
                                            <div class="mdd-item-con">
                                                <div class="mdd-zj">
													<?=$trailfoot_foot?>
                                                </div>
                                            </div>
                                        </div>
										
	
<link rel="stylesheet" href="SunbeamEditor/themes/default/default.css" />
<script charset="utf-8" src="SunbeamEditor/kindeditor.js"></script>
<script charset="utf-8" src="SunbeamEditor/lang/zh_CN.js"></script>
<script language="javascript">
	KindEditor.ready(function(K) {
		var editor = K.create('textarea[name="message_text"]', {
			cssPath : '../../SunbeamEditor/plugins/code/prettify.css',
			uploadJson : '../../SunbeamEditor/php/upload_json.php',
			fileManagerJson : '../../SunbeamEditor/php/file_manager_json.php',
			allowFileManager : false,
			items : [
						'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
						'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
						'insertunorderedlist', '|', 'emoticons', 'image', 'link'],
			afterBlur: function(){this.sync();}
		});
	});
</script>
	
										<!--评价-->
                                        <div class="mdd-item" id="d-mdd-pj">
                                            <div class="title"><h3>驴友评价</h3></div>
                                            <div class="mdd-item-con">
                                                <div class="mdd-pj">
                                                    <div class="pj-hd">
                                                        <div class="pj-title">说点什么吧...</div>
														<?php  if($_SESSION['kboy_userid']==''){?>
                                                        <div class="btn-group"><a href="reg.php">注册</a><a href="login.php">登录</a></div>
														<?php } ?>
                                                    </div>
													<form name="myform" id="myform" method="post" action="trailfoot_messagesave.php?action=add">
													<input type="hidden" id="newsid" value="<?=$newsid?>" name="newsid" />
                                                    <div class="pj-box">
                                                        <div class="pj-text">
														  <textarea name="message_text" id="message_text"></textarea>
                                                        </div>
                                                        <div class="pj">
                                                            <div class="yzm"><span class="tips">验证码：</span><input type="text" name="message_passcode" value="" id="message_passcode"><span class="pic"> <img src="function/code.php" width="105" height="36" class="reshCode imgCode"/></span></div>
                                                            <div class="send"><input type="submit" value="发布" /></div>
                                                        </div>
                                                    </div>
													</form>
                                                    <div class="pj_bd">
                                                        <div class="tips">评论</div>
                                                        <div class="pj-list">
                                                            <div class="pj-list-in">
                                                                <ul>
						<?php
								$SQL = "";
								$pagesize = 10; // 分页数量
								$pageval = chkstr(trim($_REQUEST['page'])); // 获取Page的值
								if($pageval){
									if(!is_numeric($pageval)){
										echo erro("Page Error");
									}
									if($pageval <= 1){
										$pageval = 1;
									}
									$page = ($pageval-1) * $pagesize;
									$page .= ",";
								}else{
									$pageval = 1;
								}
								
								$pagesql = "select * from kboy_trailfoot_message where newsid=$newsid order by id desc";
								$pagenum = mysql_num_rows(mysql_query($pagesql)); // 总记录数
								$pagecount = ceil($pagenum/$pagesize); // 共分多少页
								if($pageval > $pagecount){
									$pageval = $pagecount;
								}
								
								$news_sql = $pagesql." limit $page $pagesize";
								$news_rows = mysql_query($news_sql);
								$i = 1;
								while($news_rs = mysql_fetch_array($news_rows)){
						?>
                                                                    <li class="pj-list-box">
                                                                        <div class="pj-l">
                                                                            <div class="pic"><a href="forum_news.php?uid=<?=$news_rs['uid']?>" target="_blank"><img src="<?=getClassName("kboy_user","user_face","uid=".$news_rs['uid'])?>" width="48" height="48" alt=""></a></div>
                                                                            <div class="pj-det">
                                                                                <span><a href="forum_news.php?uid=<?=$news_rs['uid']?>" target="_blank"><?=getClassName("kboy_user","user_face","uid=".$news_rs['uid'])?></a></span>
                                                                                <p><?=stripslashes($news_rs['message_text'])?></p>
                                                                            </div>
                                                                        </div>
                                                                        <div class="pj-date"><?=$news_rs['message_addtime']?></div>
                                                                    </li>
						<?php
								}
						?>
                                                                </ul>
                                                            </div>
						<?php
								if($pagenum > $pagesize){
									echo "<div class=\"pagination\"><ul>";
									$url = "trailfootview.php?newsid=$newsid";//当前页面
									pagebar($pagecount, $pageval, 7, $url);
									echo "</ul></div>";
								}
						?>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
										
										
                                    </div>
                                </div>
                            </div>
                        </div>
						
						
						
						<? include("_include.trail.footright.php") ?>
						
						
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--foot begin-->
	<? include("_include.bottom.footbar.php") ?>
    <!--foot begin-->
    <!--左侧悬浮 begin-->
	<? include("_include.bottom.leftbar.php") ?>
    <!--左侧悬浮 end-->
    <!--右侧悬浮导航 begin-->
	<? include("_include.bottom.rightbar.php") ?>
    <!--右侧悬浮导航 end-->
    <script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
    <script type="text/javascript" src="js/jquery.SuperSlide.2.1.1.js"></script>
    <script type="text/javascript" src="js/main.js"></script>
    <script>
    var h = $('.mdd-bd-nav').offset().top;
    
    $(window).scroll(function(){
        if($(window).scrollTop() >h ){$('.mdd-bd-nav').addClass('setfixed');}
        else{$('.mdd-bd-nav').removeClass('setfixed');}
    });

    var d_mdd_mp=$("#d-mdd-mp").offset().top-150; 
    var d_mdd_intro=$("#d-mdd-intro").offset().top-150; 
    var d_mdd_line=$("#d-mdd-line").offset().top-150; 
    var d_mdd_zj=$("#d-mdd-zj").offset().top-150; 
    var d_mdd_pj=$("#d-mdd-pj").offset().top-150; 

    $(window).scroll(function(event) {
         var isscroll=$(document).scrollTop(); 
         console.log(isscroll);
         if(isscroll>=d_mdd_pj)
         {  
            $(".mdd-bd-nav li").eq(4).addClass('on').siblings().removeClass('on');    
         }
         else if(isscroll>=d_mdd_zj)
         {  
            $(".mdd-bd-nav li").eq(3).addClass('on').siblings().removeClass('on');    
         }
         else if(isscroll>=d_mdd_line)
         {
            $(".mdd-bd-nav li").eq(2).addClass('on').siblings().removeClass('on');  
         }
         else if(isscroll>=d_mdd_intro)
         {  
            $(".mdd-bd-nav li").eq(1).addClass('on').siblings().removeClass('on');  
         }
         else if(isscroll>=d_mdd_mp)
         {

            $(".mdd-bd-nav li").eq(0).addClass('on').siblings().removeClass('on');  
         }
    });

    </script>
</body>
</html>
